package cn.com.dhcc.turbo.service.monitor.gather;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import cn.com.dhcc.app.core.base.IocBean;
import cn.com.dhcc.app.core.service.Log;
import cn.com.dhcc.app.core.service.Log.LOGTYPE;
import cn.com.dhcc.turbo.service.registry.BaseInfoService;

public class ApiStatusQuoatGatherServer {

	/*
	LOCAL_API_WEBSERVICE_CONN_STATUS("本地节点对外webservice服务连接状态"),
	LOCAL_SYS_WEBSERVICE_CONN_STATUS("本地节点注册系统接收服务连接状态"),
	LOCAL_GAP_STATUS("本地节点网闸状态"),
	LOCAL_SYNC_CONN_STATUS("管理范围内的所有同步地址的状态"),*/
	@SuppressWarnings("deprecation")
	Logger logger = Log.getExistLogger(LOGTYPE.MONITOR);
	
	@Autowired
	@Qualifier(IocBean.BASE_INFO_SERVICEIMPL_BEAN)
	BaseInfoService baseInfoService;
	/**
	 * 	LOCAL_API_WEBSERVICE_CONN_STATUS("本地节点对外webservice服务负载状态"),
	 */
	public void gatherLocalApiWebService(){
		
		
		/**
		 * 
		 * 
		 * 对外提供的链接转改不应该由自己监控。
		 * 
		 */
		/*Date now = new Date();
		try {
			NodeInfo localNode = baseInfoService.getCurrentNodeInfo();
			if(localNode==null){
				logger.error("指标["+quota.getDesc()+"]值收集失败：节点未初始化...");
				return;
			}
			//接口的负载情况：
			
		    String status = "0";
			QuotaValueOnTime onTime = new QuotaValueOnTime();
			onTime.setCanMerge(YESNO.YES.getStatus());
			onTime.setCurrentValue1(status);
			onTime.setId(UUIDGenerator.getUUID());
			onTime.setMtime(now);
			onTime.setQuotaCode(quota.getCode());
			onTime.setOwnerId(localNode.getId());
			monitorService.insertOrUpdateQuotaOnTime(onTime);
			logger.info("指标["+quota.getDesc()+"]值收集结束，值为："+status);
		} catch (Exception e) {
			logger.error("指标["+quota.getDesc()+"]值收集失败",e);
		}*/
	}
	
}
